package com.mud.dnd.domain.model;

import java.io.Serializable;
import java.lang.String;
import java.util.List;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlTransient;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * Entity implementation class for Entity: Card
 *
 */
@Entity
public class Card  extends GameItem implements Serializable {

	
	
	private List<Integer> deckIDs;
	
	private String type;
	private int rarity;
	private int dlCount;
	private List<Deck> decks;
	private List<CardAction> actions;
	
	
	private static final long serialVersionUID = 1L;

	public Card() {
		super();
	}   
	
	
	
	public Card(String name, String description, String pictureURL, String type, int rarity, User author) {
		super();
		this.name = name;
		this.description = description;
		this.pictureURL = pictureURL;
		this.rarity = rarity;
		this.rate = 0;
		this.rateCount = 0;
		this.type = type;
		this.dlCount = 0;
		this.author = author;
	}



	
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}



	public int getRarity() {
		return rarity;
	}



	public void setRarity(int rarity) {
		this.rarity = rarity;
	}


	@JsonIgnore
	public int getDlCount() {
		return dlCount;
	}



	public void setDlCount(int dlCount) {
		this.dlCount = dlCount;
	}

	@JsonIgnore
	@ManyToMany(mappedBy="cards")
	public List<Deck> getDecks() {
		return decks;
	}


	public void setDecks(List<Deck> decks) {
		this.decks = decks;
	}


	@Transient
	public List<Integer> getDeckIDs() {
		return deckIDs;
	}


	public void setDeckIDs(List<Integer> deckIDs) {
		this.deckIDs = deckIDs;
	}


	@OneToMany(mappedBy="card")
	public List<CardAction> getActions() {
		return actions;
	}



	public void setActions(List<CardAction> actions) {
		this.actions = actions;
	}





	
	
	
	
   
}
